﻿<Window x:Class="LprMiddleWare.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        DataContext="{Binding MainViewModel, Source={StaticResource Locator}}"  
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        Height="531"
        Width="632" 
        Title="车牌抓拍中间件" 
        Icon="pack://siteoforigin:,,,/Views/CarRepairBlue2.ico" 
        xmlns:dxn="http://schemas.devexpress.com/winfx/2008/xaml/navbar" 
        WindowStartupLocation="CenterScreen" 
        xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
        StateChanged="Window_StateChanged"
        IsVisibleChanged="Window_IsVisibleChanged"
        Closed="Window_Closed">
    <Window.Resources>
        <DataTemplate x:Key="DataTemplateLogEntry">
            
                <TextBlock TextWrapping="Wrap"  d:LayoutOverrides="Width, Height">
                    <Run Text="[" />
                    <Run Text="{Binding LogTime}" />
                    <Run Text="]:" />
                    <Run Text="{Binding Message}" />
                </TextBlock>
            
        </DataTemplate>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="38.947"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="0.805*"/>
        </Grid.ColumnDefinitions>
        <dxn:NavBarControl x:Name="navBarControl1" Grid.Row="1">
            <dxn:NavBarControl.Groups>
                <dxn:NavBarGroup Header="控制面板">
                    <dxn:NavBarItem >
                        <Button Content="设置" Click="Button_Click" />
                    </dxn:NavBarItem>
                </dxn:NavBarGroup>
            </dxn:NavBarControl.Groups>
            <dxn:NavBarControl.View>
                <dxn:ExplorerBarView/>
            </dxn:NavBarControl.View>
        </dxn:NavBarControl>
        <Grid Grid.Column="1" Grid.Row="1">
        	<Grid.RowDefinitions>
        		<RowDefinition/>
        		<RowDefinition Height="Auto" />
        		<RowDefinition Height="Auto"/>
        	</Grid.RowDefinitions>
        	<dxe:ImageEdit  x:Name="imageEdit1" Source="{Binding CurrentImage}" ShowBorder="False" ShowMenu="False" />
        	<Border BorderBrush="Black" Grid.Row="1">
        		<Grid x:Name="LicensePlate" Background="#FFFFFBFB"   >
        			<Grid.RowDefinitions>
        				<RowDefinition Height="Auto" />
        				<RowDefinition Height="Auto" />
        			</Grid.RowDefinitions>
        			<Grid.ColumnDefinitions>
        				<ColumnDefinition Width="Auto" MinWidth="60.003"/>
        				<ColumnDefinition Width="Auto" MinWidth="82.494"/>
        				<ColumnDefinition/>
        				<ColumnDefinition Width="Auto" MinWidth="54.636"/>
        				<ColumnDefinition Width="Auto" MinWidth="78.695"/>
        			</Grid.ColumnDefinitions>
        			<TextBlock Text="{Binding CurrentPlate.LicenseNumber}" x:Name="LicensePlateNumber" FontSize="32" d:LayoutOverrides="Width, Height" Grid.Column="2" Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Top" />
        			<Label Content="设备:" VerticalAlignment="Center" HorizontalAlignment="Center"/>
        			<Label Content="车道:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
        			<Label Content="抓拍时间:" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        			<TextBlock x:Name="DeviceId" Text="{Binding CurrentPlate.DeviceId}" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"/>
        			<TextBlock x:Name="LaneNo" Text="{Binding CurrentPlate.LanNo}" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left"/>
        			<TextBlock x:Name="CaptureTime" Text="{Binding CurrentPlate.CaptureTime, StringFormat=HH:MM:ss}" Grid.Column="4" VerticalAlignment="Center" HorizontalAlignment="Left"/>
        		</Grid>
        	</Border>
            <dxlc:GroupBox Header="系统日志" Grid.Row="2" Padding="0" >
                      
        		<dxe:ListBoxEdit ItemTemplate="{DynamicResource DataTemplateLogEntry}" MinHeight="100" ItemsSource="{Binding Logs}"  />
        	
   
            </dxlc:GroupBox>

            
        </Grid>
        <Border BorderBrush="Black" Grid.ColumnSpan="2">
        	<Border.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="#FF5E8197" Offset="1"/>
        			<GradientStop Color="#FF96CFF3"/>
        		</LinearGradientBrush>
        	</Border.Background>
        	<Label Content="车牌抓拍中间件" HorizontalAlignment="Left" FontSize="24" Margin="15,0,0,0"/>
        </Border>
    </Grid>
</Window>
